package com.zsj.doin;



import java.util.Arrays;
import java.util.Scanner;

/**
 * @authoer zsj
 * @date 2022/3/28 20:11
 */
public class kaigen {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("输入你的数字");
        int i = scanner.nextInt();
        String s = String.valueOf(i);
        char[] chars = s.toCharArray();
        if (chars.length >=8){
            System.out.println("数字必须小于8位");
            System.out.println("请重新尝试");
            return;
        }
        int[] ints = new int[chars.length];
        for (int j = 0; j < chars.length; j++) {
            ints[j]=Integer.parseInt(String.valueOf(chars[j]));
        }
        int[] daoguolaide = alg.reversalArr(ints);
        for (int k = 0; k < daoguolaide.length; k++) {
            daoguolaide[k]=(daoguolaide[k]+5)%10;
        }
        //交换位置
        int temp = 0;
        temp = daoguolaide[0];
        daoguolaide[0]=daoguolaide[daoguolaide.length-1];
        daoguolaide[daoguolaide.length-1]=temp;

        for (int i1 : daoguolaide) {
            System.out.print(i1);
        }

    }
}
